// Created by Administrator on 2015/11/30.

extends ../public/pretty_layout
block content
    .container
        div(style='padding:50px;background-color:#FFFFFF;margin-top:20px')
            form.form-horizontal(role='form' action='/user/private/#{user.nick}/recipe/publish' method='POST' enctype='multipart/form-data')
                .form-group
                    label.col-sm-2.control-label(for="title") 标题：
                    .col-sm-7: input#title.form-control(placeholder='标题' type='text' name='title' value='#{recipe && recipe.title?recipe.title:""}' required)
                .form-group
                    label.col-sm-2.control-label(for="proImg")  作品完成图：
                    .col-sm-4: input#proImg.form-control(type='file' name='finishedProductImage' required)
                .form-group
                    label.col-sm-2.control-label(for="story")  背后小故事：
                    .col-sm-9: textarea#story.form-control(placeholder='请写上这道菜背后的小故事吧！' name='backgroundStory' rows='4' draggable='false'  value='#{recipe && recipe.backgroundStory?recipe.backgroundStory:""}')
                .form-group
                    label.col-sm-2.control-label(for="ingredient")  主料：
                    .col-sm-6
                        table#ingredient.table.table-bordered
                            - for(var i=0; i<=7; i++){
                                tr
                                    td: input.form-control(placeholder='主料' type='text' name='ingredient')
                                    td: input.form-control(placeholder='用量' type='text' name='ing')
                            - }
                .form-group
                    label.col-sm-2.control-label(for="seasoning")  调料：
                    .col-sm-6
                        table#seasoning.table.table-bordered
                            - for(var i=0; i<=7; i++){
                                tr
                                    td: input.form-control(placeholder='调料' type='text' name='seasoning')
                                    td: input.form-control(placeholder='用量' type='text' name='sea')
                            - }
                .form-group
                    label.col-sm-2.control-label(for="step")  步骤：
                    .col-sm-9
                        table#step.table.table-bordered
                            - for(var i=0; i<=3; i++){
                                tr
                                    td #{i+1}
                                    td: textarea.form-control(placeholder='填写详细步骤' type='text' name='step' rows='3')
                                    td(style='width:150px'): input.form-control(type='file' name='step_img')
                            - }
                .form-group
                    label.col-sm-2.control-label(for="knack")  小技巧：
                    .col-sm-7: textarea#knack.form-control(placeholder='有什么小技巧呢？' name='knack' rows='3')
                .form-group
                    label.col-sm-2.control-label(for="keyword")  关键字：
                    .col-sm-7: input#keyword.form-control(placeholder='输入关键字，英文逗号隔开，最多5个' type='text' name='keyword')
                .form-group
                    label.col-sm-2.control-label(for="isRaw")  是否是原创：
                    .col-sm-2
                        select#isRaw(name='isRaw' required).form-control
                            option(value=1) 原创
                            option(value=0) 转载
                .form-group
                    label.col-sm-2.control-label(for="category")  所属类别：
                    .col-sm-2
                        select#category(placeholder='类别' name='category_id' required).form-control
                            each item in categories || []
                                option(value='#{item.id}') |- #{item.name}
                                if(item.children)
                                    each child in item.children
                                        option(value='#{child.id}') &nbsp;&nbsp;&nbsp;&nbsp;|- #{child.name}
                .form-group
                    label.col-sm-2.control-label(for="level")  烹饪级别：
                    .col-sm-2
                        select#level(placeholder='级别' name='cookie_level_id' required).form-control
                            each item in levels|| []
                                option(value='#{item.id}') #{item.name}
                .form-group
                    label.col-sm-2.control-label(for="diff")  烹饪难度：
                    .col-sm-2
                        select#diff(placeholder='难度' name='cookie_diff_id' required).form-control
                            each item in diffs|| []
                                option(value='#{item.id}') #{item.name}
                .form-group
                    label.col-sm-2.control-label(for="spend")  花费时间：
                    .col-sm-2
                        select#spend(placeholder='耗时' name='cookie_spend_id' required).form-control
                            each item in spends|| []
                                option(value='#{item.id}') #{item.name}
                .form-group
                    label.col-sm-2.control-label(for="craftwork")  工艺：
                    .col-sm-2
                        select#craftwork(placeholder='工艺' name='craftwork_id' required).form-control
                            each item in craftworks|| []
                                option(value='#{item.id}') #{item.name}
                .form-group
                    label.col-sm-2.control-label(for="flavour")  口味：
                    .col-sm-2
                        select#flavour(placeholder='口味' name='flavour_id' required).form-control
                            each item in flavours|| []
                                option(value='#{item.id}') #{item.name}
                .form-group
                    .col-sm-offset-3.col-sm-9
                        button.btn.btn-default(type="submit") 发布














